import ecfsConfig from '../../../config/ecfs.config.js'
import { merge } from '../../../utils/util.js'
import registerCase from '../../../config/locale/zh-CN/netCase/registerCase.js'
/**
 * [judgeIsCanSkipToEvidence 判断是否可以从立案主页跳转到证据页]
 * @param  {[page]}        page       [page组件实例]
 * @return  {[Boolean]}               [返回布尔值]
 */
export function judgeIsCanSkipToEvidence(page) {
  setTimeout(() => {
    wx.getStorage({
      key: 'operateCaseStateList',
      success(res) {
        console.log(page)
        if (!page.data.operateCaseStateList.isHasAccuser) {
          wx.showToast({
            title: registerCase.PLEASE_FIRST_FILL_ACCUSER,
            icon: 'none',
            duration: 1500,
          })
          return false
        }
        if (!page.data.operateCaseStateList.isHasAppellee) {
          wx.showToast({
            title: registerCase.PLEASE_FILL_APPELLEE,
            icon: 'none',
            duration: 1500,
          })
          return false
        }
        if (!page.data.operateCaseStateList.isHasRequest) {
          wx.showToast({
            title: registerCase.REQUEST_NOT_EMPTY,
            icon: 'none',
            duration: 1500,
          })
          return false
        }
        if (!page.data.operateCaseStateList.isHasFact) {
          wx.showToast({
            title: registerCase.FACT_NOT_EMPTY,
            icon: 'none',
            duration: 1500,
          })
          return false
        }
      },
      fail(res) { },
      complete(res) { },
    })

  }, 200)

}